fs_extra
A Rust library for more work functionality with file system.
Key features:
-
Copy files (optionally with information about the progress).
-
Copy directories recursively (optionally with information about the progress).
-
Move files (optionally with information about the progress).
-
Move directories recursively (optionally with information about the progress).
-
One method for create and write
String
content in file. -
One method for open and read
String
content from file. -
Get size folder
-
Get collection directory entries
Functions:
Function | Description |
---|---|
fs_extra::copy_items | Copies list directories and files to another place using recursive method |
fs_extra::copy_items_with_progress | Copies list directories and files to another place using recursive method, with recept information about process |
fs_extra::move_items | Moves list directories and files to another place using recursive method |
fs_extra::move_items_with_progress | Moves list directories and files to another place using recursive method, with recept information about process |
fs_extra::remove_items | Removes list files or directories |
fs_extra::file::copy | Copies the contents of one file to another |
fs_extra::file::copy_with_progress | Copies the contents of one file to another with recept information about process |
fs_extra::file::move_file | Moves file from one place to another |
fs_extra::file::move_file_with_progress | Moves file from one place to another with recept information about process |
fs_extra::file::remove | Removes a file from the filesystem |
fs_extra::file::read_to_string | Read file content, placing him into String |
fs_extra::file::write_all | Write String content into inside target file |
fs_extra::dir::create | Creates a new, empty directory at the provided path |
fs_extra::dir::create_all | Recursively create a directory and all of its parent components if they are missing |
fs_extra::dir::copy | Copies the directory contents from one place to another using recursive method |
fs_extra::dir::copy_with_progress | Copies the directory contents from one place to another using recursive method, with recept information about process]() |
fs_extra::dir::move_dir | Moves the directory contents from one place to another |
fs_extra::dir::move_dir_with_progress | Moves the directory contents from one place to another with recept information about process |
fs_extra::dir::remove | Removes directory |
fs_extra::dir::get_size | Returns the size of the file or directory |
fs_extra::dir::get_dir_content | Return DirContent which containt information about directory |
fs_extra::dir::get_details_entry | Returned information about directory entry with information which you choose in config |
fs_extra::dir::ls | Returned collection directory entries with information which you choose in config |
Usage
Add this to your Cargo.toml
:
[]
= "1.1.0"
and this to your crate root:
extern crate fs_extra;
Examples
The following example shows how to copy a directory recursively and to follow the process.
This example created a directory dir
contains test1.txt
file and sub directory sub
. Folder sub
inside contains test2.txt
file.
Then copy ./temp/dir
and all containts to ./out/dir
use Path;
use ;
use ;
extern crate fs_extra;
use *;
use *;